<?php



require_once "php/config.php";
require_once "geshi/geshi.php";

$url = $_REQUEST['url'];
$rev = $_REQUEST['rev'];

if(!isTextPlain($url))
  die('<p class="error">This file is not plain text (only UTF-8 and Latin-1 text encodings are currently supported).</p>');

$revision = $rev ? '--revision '.$rev  : '';
$command = "svn cat {$url} {$svnAuth} {$revision} ";
$content = shellCommand($command);


$content =  (is_array($content)) ? implode($content) : $content;
$content = utf8_encode($content);





$lang = getLanguageName($url);
$geshi = new GeSHi($content,$lang);
$geshi->set_line_style('color: #000;', 'color: #000;');
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); 
$geshi->set_tab_width(4);
$geshi->set_header_type(GESHI_HEADER_NONE);
echo $geshi->parse_code();




